import http from "./http.js";

const api = {
    getLoginCode: async (params) => {
        return http.get("/WxWork/GetLoginCode", params);
    },
    getStateToUser: async (params) => {
        return http.get("/WxWork/GetStateToUser", params);
    },
    sendSms: async (params) => {
        return http.get("/WxWork/SendSms", params);
    },
    verifyMobile: async (params) => {
        return http.get("/WxWork/VerifyMobile", params);
    },
    getDepartment: async (params) => {
        return http.get("/WxWork/GetDepartment", params);
    },
    syncDepartment: async (params) => {
        return http.get("/WxWork/SyncDepartment", params);
    },
    //获取审批列表
    getSalarySummaries: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/GetSalarySummaries?state=" + state, params);
    },

    //详情
    /**
     * @param {
     *     "userId":"hazelYingYing",
     *     "dataDate":"2025-07-01"
     * }
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    getSalaryPerformances: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/GetSalaryPerformances?state=" + state, params);
    },
    /**
     * 审批
     * @param params
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    auditSalaryPerformances: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/AuditSalaryPerformances?state=" + state, params);
    },
    /**
     * 自己填报
     * @param params
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    putSalaryPerformances: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/PutSalaryPerformances?state=" + state, params);
    },
    getSalaryModels: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/GetSalaryModels?state=" + state, params);
    },

    getCascade: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/GetCascade?state=" + state, params);
    },

    getSaleryModelDetails: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/GetSaleryModelDetails?state=" + state, params);
    },

    saveSaleryModelDetail: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/Salary/SaveSaleryModelDetails?state=" + state, params);
    },

    getTagByCon: async (params) => {
        let state = localStorage.getItem("token");
        return http.post("/WxWork/GetTagByCon?state=" + state, params);
    },

    /**
     * 薪资自评列表
     */
    getSalarySelfEvaluationList(){
        let state = localStorage.getItem("token");
        return http.get("/Salary/GetSalarySelfEvaluationList", {state: state});
    },


    /**
     * 薪资审批列表
     * params:{
     *     "userIds":["hazelYingYing"],
     *     "departmentIds":[],
     *     "startDate":"2025-06-01",
     *     "endDate":"2025-09-01"
     * }
     */
    getSalaryLeaderEvaluationList(params){
        let state = localStorage.getItem("token");
        return http.post("/Salary/GetSalaryLeaderEvaluationList?state=" + state, params);

    }


}
export default {...api}